Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Solution' #339

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

'Solution' #339

wants to merge 4 commits into from

Conversation

Kavbian
Copy link

@Kavbian Kavbian commented Jul 31, 2023

No description provided.

app/customer.py Outdated
Comment on lines 30 to 33
products_price = 0
for product, amount in self.products_cart.items():
products_price += shop.products[product] * amount

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use sum() function

app/main.py Outdated
Comment on lines 41 to 42
best_shop[0] = shop
best_shop[1] = trip_price

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
best_shop[0] = shop
best_shop[1] = trip_price
best_shop = [shop, trip_price]

app/shop.py Outdated
self.products = products

def receipt(self, customer: object) -> str:
date = datetime(2021, 1, 4, 12, 33, 41)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to hardcode it

app/shop.py Outdated
self.products = products

def receipt(self, customer: object) -> str:
date = datetime.now()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests failed. To fix them do not use
from datetime import datetime
instead use
import datetime

Copy link

@ArsenPidhoretskyi ArsenPidhoretskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants